package com.dc;

import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.system.ApplicationHome;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import java.io.File;


@Slf4j
@EnableTransactionManagement
@EnableAsync
@EnableScheduling
@EntityScan(basePackages = {"com.dc.entity"})
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
public class Application
{
    public static void main(String[] args)
    {
        // System.setProperty("spring.devtools.restart.enabled", "false");
        ConfigurableApplicationContext run = SpringApplication.run(Application.class, args);

        ConfigurableEnvironment env = run.getEnvironment();
        String property = System.lineSeparator();
        log.info(property + "----------------------------------------------------------" + property +
                        "        Application: '{}' is running Success!" + property +
                        "        Local URL: \thttp://localhost:{}" + property +
                        "        Document:\thttp://localhost:{}/swagger-ui/index.html" + property +
                        "----------------------------------------------------------",
                env.getProperty("spring.application.name"),
                env.getProperty("server.port"),
                env.getProperty("server.port"));
        log.info("启动成功");


    }
}

